package com.g2one.gtunes

import grails.test.*

class AlbumControllerTests extends grails.test.ControllerUnitTestCase {
    protected void setUp() {
        super.setUp()
    }

    protected void tearDown() {
        super.tearDown()
    }

	void testList() {
		mockDomain(Album, [new Album(title: "Odelay"),
						   new Album(title: "Abbey Road")] )
		
		def model = controller.list()
		assertEquals 2, model.albumInstanceList.size()
	}
	
	void testShow() {
		mockDomain(Album, [new Album(id: 1, title: "Aha Shake Heartbreak")] )
		mockParams.id = 1
		controller.show()
		
//		assertEquals "show", renderArgs.view
		assertEquals 1, renderArgs.model.albumInstance.id
		assertEquals "Aha Shake Heartbreak", renderArgs.model.albumInstance.title
	}
}
